xen/arm: introduce vwfi parameter
authorStefano Stabellini <sstabellini@kernel.org>
Wed, 1 Mar 2017 19:43:15 +0000 (11:43 -0800)
committerStefano Stabellini <sstabellini@kernel.org>
Tue, 7 Mar 2017 19:23:30 +0000 (11:23 -0800)
commitf85fc979a6859541dc1bf583817ca5cce9287e1e
tree3e950efbda39a85641932e66d548e687f0d5ab05
parent9967251965a4cea19e6f69f7c5472174c4c5b971
xen/arm: introduce vwfi parameter

Introduce new Xen command line parameter called "vwfi", which stands for
virtual wfi. The default is "trap": Xen traps guest wfi and wfe
instructions. In the case of wfi, Xen calls vcpu_block on the guest
vcpu; in the case of guest wfe, Xen calls vcpu_yield on the guest vcpu.
The behavior can be changed by setting vwfi to "native", in that case
Xen doesn't trap neither wfi nor wfe, running them in guest context.

The result is strong reduction in irq latency (from 5000ns to 2000ns,
measured using https://github.com/edgarigl/tbm, the physical timer, and
1 pcpu dedicated to 1 vcpu). The downside is that the scheduler thinks
that the guest is busy when actually is sleeping, leading to suboptimal
scheduling decisions.

Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: Julien Grall <julien.grall@arm.com>
docs/misc/xen-command-line.markdown
xen/arch/arm/traps.c